import request from '@/api/myRequest'
// 获取品牌列表
function findAllBrand() {
  return request({
    url: `/lejuAdmin/brand/findAllBrand`,
    method: 'GET'
  })
}
// 创建品牌
function addBrand(data) {
  return request({
    url: `/lejuAdmin/brand/addBrand`,
    method: 'POST',
    data
  })
}
// 更新品牌
function updateBrand(data) {
  return request({
    url: `/lejuAdmin/brand/updateBrand`,
    method: 'POST',
    data
  })
}
// 删除品牌
function delBrand(id) {
  return request({
    url: `/lejuAdmin/brand/delBrand/${id}`,
    method: 'DELETE'

  })
}
// 分类查询
function getAllCategory() {
  return request({
    url: `/lejuAdmin/category/getAllCategory`,
    method: 'GET'
  })
}
// 分页查询商品
function productsByPage(start, limit, data) {
  return request({
    url: `/lejuAdmin/product/productsByPage/${start}/${limit}`,
    method: 'POST',
    data
  })
}
// 更改最新
function switchNewStatus(data) {
  return request({
    url: `/lejuAdmin/product/switchNewStatus`,
    method: 'POST',
    data
  })
}
// 更改推荐
function switchRecommandStatus(data) {
  return request({
    url: `/lejuAdmin/product/switchRecommandStatus`,
    method: 'POST',
    data
  })
}
// 更改发布
function switchPublishStatus(data) {
  return request({
    url: `/lejuAdmin/product/switchPublishStatus`,
    method: 'POST',
    data
  })
}
// 更改审核
function switchVerifyStatus(data) {
  return request({
    url: `/lejuAdmin/product/switchVerifyStatus`,
    method: 'POST',
    data
  })
}
// 删除商品
function delproduct(productId) {
  return request({
    url: `/lejuAdmin/product/del/${productId}`,
    method: 'DELETE'
  })
}
// 新增商品
function addProductAndSkus(data) {
  return request({
    url: `/lejuAdmin/product/addProductAndSkus`,
    method: 'POST',
    data
  })
}
// 更新商品
function updateProductAndSkus(data) {
  return request({
    url: `/lejuAdmin/product/updateProductAndSkus`,
    method: 'POST',
    data
  })
}
function productSkusDetail(productId) {
  return request({
    url: `/lejuAdmin/product/productSkusDetail/${productId}`,
    method: 'GET'
  })
}
// 获取详情/lejuAdmin/product/productSkusDetail/{productId}
export {
  findAllBrand, addBrand, updateBrand, delBrand, getAllCategory, productsByPage, switchNewStatus, switchRecommandStatus, switchPublishStatus, delproduct,
  switchVerifyStatus, addProductAndSkus, updateProductAndSkus, productSkusDetail
}
